home *** CD-ROM | disk | FTP | other *** search
- /*
- File: math.h
-
- Contains: C Interface to the Macintosh Libraries
-
- Version: Technology: StdCLib 3.4
- Release: 3.6d2
-
- Copyright: © 1987-1996 by Apple Computer, Inc., all rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
-
- #ifndef __MATH_H__
- #define __MATH_H__
-
- #ifndef __CONDITIONALMACROS__
- #include <ConditionalMacros.h>
- #endif
-
-
- #if PRAGMA_ONCE_SUPPORTED
- #pragma once
- #endif /* PRAGMA_ONCE_SUPPORTED */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #elif PRAGMA_PACK_SUPPORTED
- #pragma pack(push, 2)
- #endif
-
-
-
-
- /*
- Strictly conforming implementations must have the parameters to these routines
- be double, not long double. They still get evaluated to long double precision
- on the 68K. We expect that a lot of this confusion will eventually get settled
- by NCEG and then we will do it the NCEG way.
- */
-
- #if __STDC__ || GENERATINGPOWERPC
- typedef double _float_eval;
- #else
- typedef long double _float_eval;
- #endif /* __STDC__ || GENERATINGPOWERPC */
-
-
- #define HUGE_VAL __inf()
-
- /*
- * We put underscores on the formal parameter names to reduce name space pollution.
- * Plum-Hall tests require that we do this: they have macros called exp, size etc.
- */
-
- /*
- * ANSI routines
- */
-
- #if PRAGMA_IMPORT_SUPPORTED
- #if defined(__CFM68K__)
- #pragma import off
- #endif /* defined(__CFM68K__) */
-
- #endif /* PRAGMA_IMPORT_SUPPORTED */
-
-
- extern _float_eval sin(_float_eval _x);
- extern _float_eval cos(_float_eval _x);
- extern _float_eval tan(_float_eval _x);
- extern _float_eval asin(_float_eval _x);
- extern _float_eval acos(_float_eval _x);
- extern _float_eval atan(_float_eval _x);
- extern _float_eval atan2(_float_eval _y, _float_eval _x);
- extern _float_eval sinh(_float_eval _x);
- extern _float_eval cosh(_float_eval _x);
- extern _float_eval tanh(_float_eval _x);
- extern _float_eval exp(_float_eval _x);
- extern _float_eval log(_float_eval _x);
- extern _float_eval log10(_float_eval _x);
- extern _float_eval frexp(_float_eval _x, int *_exp);
- extern _float_eval ldexp(_float_eval _x, int _n);
-
- extern _float_eval modf(_float_eval _x, _float_eval *_ip);
-
- extern _float_eval pow(_float_eval _x, _float_eval _y);
- extern _float_eval sqrt(_float_eval _x);
- extern _float_eval floor(_float_eval _x);
- extern _float_eval ceil(_float_eval _x);
- extern _float_eval fmod(_float_eval _x, _float_eval _y);
- extern _float_eval fabs(_float_eval _x);
-
- extern _float_eval __inf(void );
-
- #if PRAGMA_IMPORT_SUPPORTED
- #if defined(__CFM68K__)
- #pragma import on
- #endif /* defined(__CFM68K__) */
-
- #endif /* PRAGMA_IMPORT_SUPPORTED */
-
-
- /*
- * Apple extensions
- */
-
- #if defined(__useAppleExts__) || defined(applec) && !defined(__STDC__) || defined(__PPCC__) && !defined(__STDC__)
-
- /* note fcvt and ecvt are not multi-thread safe / not re-entrant. */
- /* please don't use them. */
-
- extern char *ecvt(extended value, int ndigit, int *decpt, int *sign);
- extern char *fcvt(extended value, int ndigit, int *decpt, int *sign);
-
- /* note fcvt_r and ecvt_r are multi-thread safe / re-entrant */
- /* equivalents to fcvt and ecvt. These function are not available in */
- /* versions of StdCLib prior to 3.5a1. */
-
- extern char *ecvt_r(extended value, int ndigit, int *decpt, int *sign, char *dest);
- /* Imported from StdCLib. */
- extern char *fcvt_r(extended value, int ndigit, int *decpt, int *sign, char *dest);
- /* Imported from StdCLib. */
-
- #if PRAGMA_IMPORT_SUPPORTED
- #if defined(__CFM68K__)
- #pragma import off
- #endif /* defined(__CFM68K__) */
-
- #endif /* PRAGMA_IMPORT_SUPPORTED */
-
-
- extern _float_eval hypot(_float_eval _x, _float_eval _y);
-
- #if GENERATINGPOWERPC
- /*
- * If you use modf() you must decide which version you mean: modf(),
- * modff() or modfl(). The usual promotions to long double don't
- * help here because we're using a pointer.
- *
- * NOTE: both modff() and modfl() are not ANSI defined functions;
- * if you use it, your code may not be portable.
- */
-
- extern float modff(float _x, float *_ip);
- extern long double modfl(long double _x, long double *_ip);
-
- #else
- /*
- * For the 68K, these are defined as macros which evaluate to modf(),
- * since for the 68K world there is no difference between modf(), modff(),
- * and modfl(). (Functional implementations are also provided if you are
- * linking with MathLib.o. If you link with CSANELib.o and Math.o,
- * attempting to use the function instead of the macro will cause link
- * errors as these are not available as functions in the older SANE engine.)
- */
-
- extern float modff(float _x, float *_ip);
- #define modff(_x,_ip) modf(_x,_ip)
- extern long double modfl(long double _x, long double *_ip);
- #define modfl(_x,_ip) modf(_x,_ip)
-
- #endif /* GENERATINGPOWERPC */
-
-
- #if PRAGMA_IMPORT_SUPPORTED
- #if defined(__CFM68K__)
- #pragma import on
- #endif /* defined(__CFM68K__) */
-
- #endif /* PRAGMA_IMPORT_SUPPORTED */
-
-
- #endif /* defined(__useAppleExts__) || (( defined(applec) && ! defined(__STDC__) ) || ( defined(__PPCC__) && ! defined(__STDC__) )) */
-
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #elif PRAGMA_PACK_SUPPORTED
- #pragma pack(pop)
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __MATH_H__ */
-
-